//
//  ByInformationViewModel.m
//  jmsfhz_ios
//
//  Created by pro on 16/8/3.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "ByInformationViewModel.h"

#import "ByNetNewsApi.h"

@implementation ByInformationViewModel

- (void)postQuery:(ByNetParamsModel *)params {
    
    void (^failure)(ByNetBaseResult *result) = nil;
    
    if([self.postDelegate respondsToSelector:@selector(postQueryFailure:)]) {
        
        failure = ^(ByNetBaseResult *result){
            [self.postDelegate postQueryFailure:result];
        };
    }
    
    [ByNetNewsApi newsQuery:params success:^(ByNetBaseResult *result) {
        if (self.postDelegate) {
            [self.postDelegate postQuerySuccess:result];
        }
    } failure:failure];
}
@end
